<template>
	<div class="container">
		<div class="jx-return-container">
      <i class="iconfont icon-back" @click="back"></i><span class="cube-title">结算单详情</span>
    </div>
    <div class="jx-detail">
      <div class="detail-item">
        <div class="item_2 item">
          <div class="title">
            基本信息
          </div>
          <div class="list">
            <span>生成日期：</span>
            <div class="right">
              <span>{{detail.balancedAt || '--'}}</span>
            </div>
          </div>
          <div class="list">
            <span>结算单编号：</span>
            <div class="right">
              <span>{{detail.balancedNo || '--'}}</span>
            </div>
          </div>
          <div class="list">
            <span>结算方：</span>
            <div class="right">
              <span>{{detail.balanceUnitName || '--'}}</span>
            </div>
          </div>
          <div class="list">
            <span>结算周期：</span>
            <div class="right">
              <span>{{detail.balancedBeginAt || '--'}}</span><span>&nbsp;&nbsp;至</span><br/>
              <span>{{detail.balancedEndAt || '--'}}</span>
            </div>
          </div>
        </div>
        <div class="item_2 item">
          <div class="title">结算信息</div>
          <div class="list">
            <span>结算笔数：</span>
            <div class="right">
              <span>{{detail.balancedCount || '--'}}</span>
            </div>
          </div>
          <div class="list">
            <span>结算金额：</span>
            <div class="right">
              <span>{{detail.balancedSum || '--'}}</span>
            </div>
          </div>
          <div class="list">
            <span>结算类型：</span>
            <div class="right">
              <span>{{detail.test1 || '--'}}</span>
            </div>
          </div>
          <div class="list">
            <span>结算状态：</span>
            <div class="right">
              <span>{{detail.balanceStatus || '--'}}</span>
            </div>
          </div> 
          <div class="list">
            <span>最后付款日：</span>
            <div class="right">
              <span>{{detail.balancedPaymentDeadlineAt || '--'}}</span>
            </div>
          </div>
        </div>
      </div>
      <div class="detail-item">
        <div class="item">
          <div class="title">
            结算明细
          </div>
          <div class="jx-table" style="padding: 0;">
            <el-table :data="detail.details" border :span-method="objectSpanMethod" style="width: 100%" v-loading="boo.loading">
              <el-table-column type="index" label="序列" width="60" align="center">
              </el-table-column>
              <el-table-column prop="institutionOrderNo" label="订单编号" width="130" align="center" :show-overflow-tooltip="true">
              </el-table-column>
              <el-table-column prop="consumerLoginname" label="客户姓名" width="150" align="center" :show-overflow-tooltip="true">
              </el-table-column>
              <el-table-column prop="carNo" label="车牌号" width="150" align="center" :show-overflow-tooltip="true">
              </el-table-column>
              <el-table-column prop="shopName" label="服务商家" width="150" align="center" :show-overflow-tooltip="true">
              </el-table-column>
              <el-table-column prop="serviceProductName" label="商品名称" align="center" :show-overflow-tooltip="true">
              </el-table-column>
              <el-table-column prop="institutionOrderAt" label="订单时间" align="center" :show-overflow-tooltip="true">
              </el-table-column>
              <el-table-column prop="balanceStatus" label="当前状态" align="center" :show-overflow-tooltip="true">
              </el-table-column>
              <el-table-column prop="balanceSum" label="订单金额" align="center" :show-overflow-tooltip="true">
              </el-table-column>
            </el-table>
          </div>
        </div>
      </div>
    </div>
	</div>
</template>

<script>
	export default {
		data() {
			return {
        https: this.$api.finance.bill.detail,
        boo: {
          loading: false,
        },
        detail: '',
			}
		},
		mounted(){
      let _self = this
      _self.getList()
    },
		methods: {
      back(){
        history.go(-1)
      },
      getList(){
        let _self = this
        let params = {
          id: this.$route.query.id,
        }
        _self.boo.loading = true
        let success = (res)=>{
          res = res.data
          if(res.retCode == 1){
            _self.detail = res.retObject
          }else{
            _self.$message.error(res.retMsg)
          }
          _self.boo.loading = false
        }
        _self.$axios.get(`${_self.https}${params.id}`, {}, success) 
      },
    },
	}

</script>
<style scoped lang="sass">
</style>
